package com.loan.service;

import com.loan.entity.Banner;
import com.loan.repository.BannerRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by huxudong on 17/7/1.
 */
@Service
public class BannerService {

    @Autowired
    private BannerRepository bannerRepository;

    public List<Banner> findByFlag(Integer flag){
        return bannerRepository.findByFlagOrderBySort(flag);
    }

    public List<Banner> findByTagAndFlag(Integer tab ,Integer flag){
        return bannerRepository.findByTabAndFlagOrderBySort(tab,flag);
    }

}
